<?php
 mb_internal_encoding("utf-8");
 //gc_enabled();
 require "../../document/class_corpus.php";
 require "../../document/class_document.php";
 require "../../document/class_document_xml.php";

 require "../../files/tool_files_dirs.php";

 require "../../misc/class_tag.php";
 require "../../misc/tool_color.php";

 require "../../tree/class_tree.php";
 require "../../tree/class_tree_xhtml.php";
 require "../../tree/class_structure.php";
 require "../../tree/tool_tree.php";

 require "../../array/tool_array.php";

 require "../../maths/tool_maths.php";

 require "../../string/tool_string.php";
 require "../../string/class_segment.php";

 require "../../pdo/class_sql_document.php";

//$dir="../../xml/europa_complete_repair/";
//$dir="../../xml/experience02/";
//$lg_candidates=array("cs","da","de","el","en","es","et","fi","fr","hu","it","lt","lv","nl","pl","pt","sl","sw");
//$array_ids_europa=tool_corpus::get_unified_europa($dir,$lg_candidates);
//print_r($array_ids_europa);
//$motif_lg="fr";
//$exp=new sql_experience("align_word00");
//$exp=new sql_experience("align_word_exp01");
$exp=new sql_experience("align_ecr_word");
$array_obj_sql=$exp->reader_experience();
$array_data=array();

//$data=$array_obj_sql['sql_bloc']->reader_all2exec_plus_lg();
$data_lg = $array_obj_sql['sql_document']->reader_all_lg();

$check = array();
foreach($data_lg as $lg){
  $lg = $lg[0];
  $datas = $array_obj_sql['sql_bloc']->reader_lg2id_bloc($lg);
  $cpt = 0;
  $l_id_doc = 0;
  foreach($datas as $d){
    if($l_id_doc != $d["id_document"]) ++$cpt;
    if(!isset($check[$cpt])){
      $check[$cpt] = array();
    }
    if(!isset($check[$cpt][$lg.":".$d["id_document"]])){
      $check[$cpt][$lg.":".$d["id_document"]] = 0;
    }
    ++$check[$cpt][$lg.":".$d["id_document"]];
    $l_id_doc = $d['id_document'];
  }
}

foreach($check as $id_multidoc => $array_info){
  $s = array_sum($array_info);
  $c = count($array_info);
  $f = reset($array_info);
  if($s / $f != $c){
    print_r($array_info);
  }
}

die();


?>
